"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var orderApi_1 = __importDefault(require("../../../api/orderApi/orderApi"));
var constant_1 = __importDefault(require("../../../utils/constant"));
// pages/enterReport/enterReport.ts
Page({
    /**
     * 页面的初始数据
     */
    data: {
        rules: {
            enterDate: { require: { value: true, } },
            innerLocation: { require: { value: true, } },
            outerLocation: { require: { value: true, } },
            reason: { require: { value: true, } },
        }
    },
    onSubmit: function (_a) {
        var detail = _a.detail;
        // TODO gen order
        var submitDate = __assign(__assign({}, detail), { reportDateTime: detail.enterDate + ' ' + detail.enterTime });
        console.log(this.data);
        orderApi_1.default.submitOrder(submitDate);
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function () {
        this.setData(__assign(__assign({}, this.data), wx.getStorageSync(constant_1.default.USER_INFO)));
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {
    },
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {
    },
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {
    },
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {
    },
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {
    },
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {
    }
});
